import React, { useEffect, useState } from 'react';
import ReactQuill from 'react-quill';
import 'react-quill/dist/quill.snow.css';

function MyComponent() {
  const [value, setValue] = useState('');

  const fn = () => {
    console.log(value);
  };

  return (
    <>
      <button onClick={fn}>btn</button>
      <ReactQuill theme="snow" value={value} onChange={setValue} />

      <hr />

      <div dangerouslySetInnerHTML={{ __html: value }}></div>
    </>
  );
}

export default MyComponent;
